<?php

if ( !function_exists( 'apache_request_headers' ) ) {

    $headers = array( );
    foreach ( $_SERVER as $key => $value )
            if ( substr( $key, 0, 5 ) == 'HTTP_' )
                $_SERVER[ 'HTTP_REQUEST_HEADERS' ][ str_replace( ' ', '-',
                            ucwords( str_replace( '_', ' ',
                                            strtolower( substr( $key, 5 ) ) ) ) ) ] = $value;

    $_SERVER[ 'HTTP_REQUEST_HEADERS' ] = $headers();
}
else $_SERVER[ 'HTTP_REQUEST_HEADERS' ] = apache_request_headers();

var_dump( $_SERVER[ 'HTTP_REQUEST_HEADERS' ][ 'Content-Type' ] );
if ( in_array( strtoupper( $_SERVER[ 'REQUEST_METHOD' ] ),
                array( 'DELETE', 'PATCH', 'PUT' ) ) && substr( $_SERVER[ 'HTTP_REQUEST_HEADERS' ][ 'Content-Type' ],
                0, 33 ) == 'application/x-www-form-urlencoded' )
        parse_str( file_get_contents( 'php://input' ), $_POST );



var_dump( $_SERVER[ 'REQUEST_METHOD' ] );

var_dump( $_POST );
?>
